using UnityEngine;

namespace ai_library
{
	public class RandomRangeCondition<T> : ICondition<T> where T : IEntity
	{
		private int m_randMin;
		private int m_randMax;

		public RandomRangeCondition (int randMin, int randMax)
		{
			m_randMin = randMin;
			m_randMax = randMax;
			Condition = IsSatisfied;
		}

		public Condition<T> Condition
		{
			get;
			private set;
		}

		public bool IsSatisfied(T t)
		{
			return Random.Range(m_randMin, m_randMax) == 0;
		}
	}
}

